﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductManager.aspx.cs" Inherits="DigitalAnts.Admin.ProductManager" MasterPageFile="~/MasterPage/HomeAdmin.Master" %>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <table>
        <tr>
            <td>&nbsp;</td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" 
                ControlToValidate="txtproduct" runat="server" 
                ValidationExpression="^[\s\S]{1,49}$" Text="Tên sản phẩm: 1-49 Ký Tự" 
                SetFocusOnError="true" Display="Dynamic" ValidationGroup="reg" /></td>
            <td>
                &nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>Tên sản phẩm</td>
            <td>
                <asp:TextBox ID="txtproduct" runat="server" Width="150px"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                ControlToValidate="txtproduct" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
            
        </tr>
        <tr>
            <td>Hình ảnh</td>
            <td>
                <asp:FileUpload ID="fulavatar" runat="server" Width="150px"/></td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="fulavatar"
                ErrorMessage="không đúng định dạng." Display="Dynamic" ValidationGroup="txt"
                ValidationExpression=
                "^([0-9a-zA-Z_\-~ :\\])+(.jpg|.JPG|.jpeg|.JPEG|.bmp|.BMP|.gif|.GIF|.png|.PNG)$">
                </asp:RegularExpressionValidator>
            </td>
            <td>Tên người dùng</td>
            <td><asp:DropDownList ID="ddluser" runat="server" Width="150px">
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td>Thiết bị chống trộm</td>
            <td><asp:TextBox ID="txtdevice" runat="server" Width="150px"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                ControlToValidate="txtdevice" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
            <td>Màu xe</td>
            <td><asp:TextBox ID="txtcolor" runat="server" Width="150px"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                                ControlToValidate="txtcolor" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
        </tr>
        
        <tr>
            <td>Tình trạng</td>
            <td><asp:TextBox ID="txtnew" runat="server" Width="150px"></asp:TextBox>%</td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                                ControlToValidate="txtnew" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
            
            <td>Hãng sản xuất</td>
            <td><asp:DropDownList ID="ddlproducer" runat="server" Width="150px">
                </asp:DropDownList></td>
        </tr>
        
        <tr>
            <td>&nbsp;</td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                                                    ControlToValidate="txtnew" ErrorMessage="Tình trạng phải là số." 
                                                    SetFocusOnError="True" 
                    ValidationExpression="^\d+$" ValidationGroup="txt"></asp:RegularExpressionValidator>
            </td>
            <td>
                &nbsp;</td>
            
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>Giá</td>
            <td><asp:TextBox ID="txtprice" runat="server" Width="150px"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                                ControlToValidate="txtprice" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
            
            <td>Km đã đi</td>
            <td><asp:TextBox ID="txtkilometer" runat="server" Width="150px"></asp:TextBox></td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                                ControlToValidate="txtkilometer" ErrorMessage="*" ValidationGroup="txt"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>
                <asp:RegularExpressionValidator ID="regEM3" runat="server" 
                                                    ControlToValidate="txtprice" ErrorMessage="Giá phải là số." 
                                                    SetFocusOnError="True" ValidationExpression="^\d+$" ValidationGroup="txt"></asp:RegularExpressionValidator>
            </td>
            <td>
                &nbsp;</td>
            
            <td>&nbsp;</td>
            <td>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                                    ControlToValidate="txtkilometer" ErrorMessage="Kilometer phải là số." 
                                                    SetFocusOnError="True" ValidationExpression="^\d+$" ValidationGroup="txt"></asp:RegularExpressionValidator>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>Nhiên liệu</td>
            <td>
                <asp:DropDownList ID="ddlfuel" runat="server" Width="150px">
                </asp:DropDownList>
            </td>
            <td>
            </td>
            <td>Thành phố</td>
            <td><asp:DropDownList ID="ddlcity" runat="server" Width="150px"></asp:DropDownList></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:Label ID="lblmess" runat="server" Text=""></asp:Label></td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <asp:Button ID="bttAdd" runat="server" Text="ADD" Width="50px" 
                    onclick="bttAdd_Click" ValidationGroup="txt"/></td>
        </tr>
    </table>
    <asp:GridView ID="gv_product" runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" AllowPaging="True" 
        onpageindexchanging="gv_product_PageIndexChanging" 
        EnableModelValidation="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="colProductID" 
         DataNavigateUrlFormatString="~\Admin\UpdateProduct.aspx?ProductID={0}" 
                HeaderText="Edit" Text="Edit" />
        </Columns>
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="colProductID" 
         DataNavigateUrlFormatString="~\Admin\ShowProduct.aspx?ProductID={0}" 
                HeaderText="Show" Text="Show"/>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    </asp:GridView>
</asp:Content>


